﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Golden_Miner
{
    class Man
    {
        public Rectangle Rectangle { get; set; }

        /// <summary>
        /// 判断上下
        /// </summary>
        public bool isup { get; set; }        

        public Man(Rectangle rec)
        {
            isup = true;
            Rectangle = rec;
        }

        /// <summary>
        /// 画图
        /// </summary>
        /// <param name="g"></param>
        public void Draw(Graphics g)
        {
            if(isup )
            {
                g.DrawImage(Properties.Resources.人上, Rectangle);
            }
            else
            {
                g.DrawImage(Properties.Resources.人下, Rectangle);
            }
        }

        public void moveMan(bool isMoveman,int nowtime)
        {
            if (isMoveman)
            {
                if (nowtime % 2 == 0)
                {
                    isup = true;
                }
                else
                {
                    isup = false;
                }
            }
            else
                isup = true;
        }


    }
}
